<?php

namespace Brandon
{
	class Post
	{
		/**
		 * Get string value from $_POST array if it was sent
		 * @param string $value
		 * @return string|null
		 */
		public static function getString($key)
		{
			$key = (string) $key;
			return isset($_POST[$key]) ? (string) $_POST[$key] : null;
		}

		/**
		 * Get integer value from $_POST array if it was sent
		 * @param string $value
		 * @return int
		 */
		public static function getInteger($key)
		{
			$key = (string) $key;
			return isset($_POST[$key]) ? (int) $_POST[$key] : 0;
		}
	}
}
